<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <home></home>
  </div>
  <script src="./vue.js"></script>
  <script>
    const Child = {
      template: `
        <div>
          <slot name="head"></slot>
          <h3>这是子组件body</h3>  
          <slot name="foot"></slot>
        </div>
      `  
    }
    const Home = {
      template: `
        <div>
          <h2>这是父组件</h2>  
          <hr/>
          <child>
            <div slot="head">
              <button>这是头部的区域</button>  
            </div>
            <div slot="foot">
              <mark>这是尾部的区域</mark>  
            </div>
          </child>
         
        </div>
      `,
      components: {
        Child
      }
    }
    Vue.component('Home', Home)
    const vm = new Vue({
      el: '#app'
    })
  </script>
</body>
</html>